package THREAD.homework;

public class homework01 extends Thread {
    /*
    1)、通过继承java.lang.Thread类的方式创建两个线程，
    在Thread构造方法中指定线程的名称，
    并将这两个线程的名称打印出来。
     */
    public void run(){
        System.out.println(Thread.currentThread().getName());
    }

    public static void main(String[] args) {
        homework01 h1 = new homework01();
        Thread thread1 = new Thread(h1,"thread1");
        Thread thread2 = new Thread(h1,"thread2");
        thread1.start();
        thread2.start();
    }
}
